package com.team.student.service.impl;

import com.team.student.entity.Grade;
import com.team.student.entity.GradeExample;
import com.team.student.mapper.GradeMapper;
import com.team.student.service.GradeService;
import com.team.student.util.MyBatisUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class GradeServiceImpl  implements GradeService {
    @Override
    public List<Grade> getAllGrade() {
        SqlSession ss= MyBatisUtil.getSession();
        List<Grade> li= null;
        try {
            GradeMapper mapper = ss.getMapper(GradeMapper.class);
            li = mapper.selectByExample(new GradeExample());
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            MyBatisUtil.closeSession();
        }
        return li;
    }
}
